<span id="noticeArea" style="position:relative">
    <span>
    	<b id="noticeTip" class="remind hide">
			<i class="i"></i>
			<em id="countNotice">0</em>
		</b>
    	<a href="javascript:void(0)"><@i18n name='消息'/><span class="passport-arrow">▼</span></a>
    </span>
   	
   	<div id="noticeMenu" class="layer_topmenu_list hide" style="position:fixed">
       	<div><ul>
       		<#assign us = fn.service('loginUser')>
       		<#if us.hasLinkPermission(fn.linkNoBase('/espirit/purchase/myRfqItem.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/purchase/myRfqItem.search')}?newSearch=true','rfqNotice','purchase.myRfqItem','采购询价');"><span id="rfqNotice">0</span> 条新询价</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/purchase/supplierWork.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/purchase/supplierWork.search')}?newSearch=true','purchaseNotice','Message','新的采购');"><span id="purchaseNotice">0</span> 新的采购</li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/purchase/sINeedToBuyItem.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/purchase/sINeedToBuyItem.search')}?newSearch=true&fromMenu=true','needToBuyItemNotice','Message','新的我的采购');"><span id="needToBuyItemNotice">0</span> 新的我的采购</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/process/approvingSI.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/process/approvingSI.search')}?newSearch=true&fromMenu=true','approvingSINotice','Message','新的销售审批');"><span id="approvingSINotice">0</span> 新的销售审批</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/process/approvingPI.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/process/approvingPI.search')}?newSearch=true&fromMenu=true','approvingPINotice','Message','新的采购审批');"><span id="approvingPINotice">0</span> 新的采购审批</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/process/approvingPLI.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/process/approvingPLI.search')}?newSearch=true&fromMenu=true','approvingPLINotice','Message','新的发货审批');"><span id="approvingPLINotice">0</span> 新的发货审批</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/purchase/purchaseOrderItem.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/purchase/purchaseOrderItem.search')}','receiveNotice','Message','新的采购到货');"><span id="receiveNotice">0</span> 新的采购到货</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/sale/salesOrderItem.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/sale/salesOrderItem.search')}','siReceiveNotice','Message','新的销售到货');"><span id="siReceiveNotice">0</span> 新的销售到货</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/sale/packingList.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/logistics/shipping.search')}','shipNotice','Message','新的发货通知');"><span id="shipNotice">0</span> 新的发货通知</a></li>
			</#if>
			<#if us.hasLinkPermission(fn.linkNoBase('/espirit/purchase/rfqItemAllocate.search',true),false)>
				<li><a href="javascript:void(0)" onclick="javascript:openNotice('${fn.link('/espirit/purchase/rfqItemAllocate.search')}','rfqItemAllocateNotice','Message','新的询价分配');"><span id="rfqItemAllocateNotice">0</span> 新的询价分配</a></li>
			</#if>
			<li><a href="javascript:void(0)" onclick="javascript:openNotice(null,'messageNotice','<@i18n name='commons.main'/>','<@i18n name='commons.main'/>','新的消息');"><span id="messageNotice">0</span> 新的消息</a></li>
		</ul></div>
	</div>
	
	<script type="text/javascript"> 
		$(document).ready(function(){
			var tipTimeName;
			var $noticeArea = $('#noticeArea');
			var $noticeMenu = $('#noticeMenu');
			$('body').append($noticeMenu);
			
			$('#noticeArea,#noticeMenu').mouseleave(function(){
				tipTimeName = setTimeout(function() {
					$('#noticeMenu').hide();
				}, 400);
			}).mouseenter(function(){
				if (tipTimeName != null) {
					clearTimeout(tipTimeName);
				}
				var pos = $noticeArea.position();
				$noticeMenu.css({'left': pos.left, 'top': pos.top + 20});
				$noticeMenu.show();
			});
			
			when('loadAndUpdateNotice', function() {
				loadAndUpdateNotice();
			});
		});
	</script>
</span>